import 'package:car_map/page/res/gaps.dart';
import 'package:car_map/page/res/styles.dart';
import 'package:car_map/widget/load_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

///医院列表
class WidgetHospitalList extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Container(
      padding: EdgeInsets.only(left: 10.0,right: 10.0),
      child: ListView.builder(itemBuilder: (context, index) {
        return itemList();
      }, itemCount: 10,shrinkWrap: true,physics: new NeverScrollableScrollPhysics(),),
    );
  }


  Widget itemList() {
    return Container(
      margin: EdgeInsets.only(top: 10.0),
      height: ScreenUtil().setHeight(150.0),
      child: Row(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: <Widget>[
          Container(
            width: ScreenUtil().setWidth(150.0),
            height: ScreenUtil().setHeight(150.0),
            child: LoadImage(
                'http://file.youlai.cn/cnkfile1/M00/03/C1/oYYBAFcQszSABh_tAAEPjlC2mvE244.jpg'),
          ),
    Gaps.hGap10,
         Container(
           width: ScreenUtil().setWidth(530),
           child:  Column(
             mainAxisAlignment: MainAxisAlignment.spaceEvenly,
             children: <Widget>[
               Row(
                 mainAxisAlignment: MainAxisAlignment.spaceBetween,
                 children: <Widget>[
                   Text('陕西西安唐都医院',style: TextStyle(fontSize: ScreenUtil().setSp(28.0)),),
                   Text('10.6km',style: TextStyles.textGray14,)
                 ],
               ),
               Row(
                 children: <Widget>[
                   Text('三甲',style: TextStyle(color: Colors.orange,fontSize: ScreenUtil().setSp(26.0)),),
                   Text('|',style: TextStyle(color: Colors.orange,fontSize: ScreenUtil().setSp(26.0)),),
                   Text('综合',style: TextStyle(color: Colors.orange,fontSize: ScreenUtil().setSp(26.0)),),
                 ],
               ),
               Row(
                 mainAxisAlignment: MainAxisAlignment.spaceBetween,
                 children: <Widget>[
                   itemFeatures(title: '挂号'),
                   itemFeatures(title: '取报告'),
                   itemFeatures(title: '住院'),
                   Text('已预约:123',style: TextStyle(fontSize: ScreenUtil().setSp(24.0),color: Colors.black45))
                 ],
               ),
             ],
           ),
         )
        ],
      ),
    );
  }

  Widget itemFeatures({String title}){
    return Container(
      child: Row(
        children: <Widget>[
          Icon(Icons.confirmation_number,color: Colors.teal,size: 18.0,),
          Text('${title}',style: TextStyle(fontSize: ScreenUtil().setSp(24.0)),),
        ],
      ),
    );
  }

}